AI Service
Overview
The AI Service adds an intelligent assistant layer to ALP-CONNEX. It connects to live process data and a customizable knowledge base to provide natural-language explanations, trend analysis, operational recommendations, and free-form Q&A — all in the context of your actual infrastructure.
Key Features
Chat Assistant
A conversational interface for asking questions about your plant or infrastructure:
- Ask free-form questions like "What is the current state of Transformer 1?"
- Tie questions to a specific datapoint for context-aware answers
- Responses can be streamed in real-time (for UIs) or returned as a single JSON response
- The assistant automatically incorporates relevant knowledge base documents and live signal data into its answers
Edge Inference
The chat assistant does not have to run centrally. In the UI you can point a conversation at any online fleet device instead of the central service, and the prompt is then answered by a model running on that device.
This matters in two situations:
- Data protection — the prompt and its answer never leave the device, which may be a requirement for process data at certain sites.
- Availability — when the central AI service is unreachable, an edge device can still answer.
The trade-offs are real and worth knowing before relying on it:
| Management AI | Edge device | |
|---|---|---|
| Knowledge base and live process image as context | Yes | No — the local model answers from the prompt alone |
| Can create or change connectors, signals, mappings | Yes | No |
| Delivery | Streamed token by token | Returned as a whole once the device has finished |
| Latency | Immediate | The prompt is queued as a fleet command and collected on the device's next heartbeat |
Technically the prompt travels as an AI Chat fleet command. The agent forwards it to the inference endpoint configured as AI_SERVICE_URL (by default a service listening on port 8090 on the device itself) and returns the answer as the command's result. If the device has no local model running, the command fails with INFERENCE_UNAVAILABLE; if the model takes too long, with INFERENCE_TIMEOUT. See Additional Services / Fleet Management for how fleet commands work.
The endpoint on port 8090 is not the model itself but an adapter that speaks the same /api/ai/chat contract as the central service. It in turn talks to the model runtime, which typically exposes an OpenAI-compatible API. Deploying both as one application bundle is what makes local inference practical on hardware with an NPU; the bundled VENTUNO Edge AI example does exactly that and is described under Additional Services / Fleet Management.
The command's timeout is 120 seconds by default and can be set per request between 5 and 600. Small models on edge hardware answer noticeably slower than the central service, so allow more time for long prompts.
Signal Explanation
Get a plain-language explanation of any datapoint in your process image:
- What the signal represents
- Its current value and trend
- What the current reading means in operational context
Useful for operators who need to quickly understand unfamiliar signals without looking up documentation manually.
Trend Analysis
Perform automated analysis of a signal over a configurable time window:
- Computed statistics: count, min, max, mean, standard deviation, trend direction
- AI-generated interpretation of the data pattern
- Detection and listing of anomalies
Default analysis window is 60 minutes, but can be adjusted per request.
Operational Recommendations
Request structured, actionable recommendations for a specific datapoint situation:
- Severity classification
- Short summary of the situation
- Prioritized list of recommended actions with rationale
- References to relevant knowledge base documents (if available)
Ideal for decision support when operators encounter unusual readings or warning conditions.
Process Image Summary
Get a high-level overview of the entire process image in one request:
- All currently available datapoints
- Total datapoint count
- AI-generated summary of the overall plant/process state
Knowledge Base
Build and maintain a domain-specific knowledge base that the AI uses to ground its answers:
- Upload documents — PDF, Markdown, CSV, and TXT files are supported
- Documents are automatically split into chunks and indexed for retrieval
- The AI references relevant knowledge chunks when answering questions, generating explanations, or making recommendations
- Check status — see the collection name and number of indexed chunks
- Reset — clear and rebuild the knowledge base when needed
The knowledge base is the primary mechanism for tailoring the AI to your specific infrastructure. Upload your operating procedures, threshold definitions, equipment manuals, switching rules, or site-specific guidelines — the AI will use this domain knowledge to produce more relevant explanations and more actionable recommendations.
System Configuration via Chat
The AI assistant can directly create, update, and delete resources in the Management API on your behalf. Instead of navigating the UI manually, you can instruct the AI in natural language:
- Connectors — Create, read, update, and delete MQTT, IEC 104, and REST connectors
- Signals — Create, read, update, and delete IEC 104 address points
- Mappings — Create, read, update, and delete data point mappings (MQTT and REST)
Examples:
- "Create an MQTT connector called 'Weather Station' on port 1883"
- "Add a signal for temperature at CASDU 225, IOA 100, Type 36"
- "Create a mapping that extracts data.temperature from topic sensors/weather"
- "List all connectors and their status"
- "Delete the mapping named 'old-sensor'"
Safety: Destructive operations (delete, update) require explicit confirmation before execution. Read and create operations proceed immediately.
Debug / Inspection
A debug mode for the chat endpoint that shows how the AI arrived at its answer:
- Which knowledge chunks were retrieved
- Similarity scores for each chunk
- The full prompt that was sent to the AI
- Useful for validating answer quality and tuning the knowledge base
Configuration
| Setting | Required | Description |
|---|---|---|
LLM_PROVIDER | Yes | Which AI backend to use |
LLM_MAX_TOKENS | No | Maximum response length |
| Live data connection | Yes | Host and port of the process data store |
| Knowledge store connection | Yes | Host and port of the knowledge base backend |
| Model selection | No | Choose which model to use (depends on provider) |
Troubleshooting
Health Check
The health endpoint reports whether all required services are reachable:
GET /api/ai/health
It shows connectivity status for:
- AI response backend
- Knowledge store
- Live data source
No Knowledge Results
If the AI doesn't reference uploaded documents:
- Check knowledge status — are chunks indexed?
- Try the debug endpoint to see retrieved chunks and similarity scores
- Re-upload or reindex if documents were changed
Streaming Not Working
The chat endpoint streams responses by default (SSE). If your client doesn't support streaming, send an Accept: application/json header to receive the full response as JSON instead.